<template lang="pug">
  .right-menu(:style='isRightBar819 ? "display: none;" : ""')
    ul.right-menu-list
      el-tooltip(
        effect="dark",
        placement="left",
        v-for="(item, index) in menuDataList",
        :key="index",
        :content="item.isActive ? item.act_title : item.dis_title",
        @click.native="handleSytemMenuItem(item, index)")
          li.menu-item.pos-r
            span.menu-icon(:style="getBgColorStyle")
              i.iconfont(v-show="item.isActive", :class="item.active_icon", :style="getColorStyle")
              i.iconfont(v-show="!item.isActive", :class="item.icon", :style="getColorStyle")
            p.menu-text.pos-a.omit(:style="getColorStyle") {{item.type_id === 'praise'? getPraiseCount : item.title}}

</template>

<script>
import themeMixin from '@/mixins/theme'
import menuMixin from '@/mixins/menu'
import { filterMenu } from '@/utils/menu'
import { mapGetters } from 'vuex'
export default {
  mixins: [themeMixin, menuMixin],
  data () {
    return {
      rightBar819: $globalconfig.RIGHTBAR819,
    }
  },
  computed: {
    ...mapGetters([
      'praiseCount'
    ]),
    isRightBar819() {
      if (this.rightBar819 && this.panoInfo && this.panoInfo.templatetype < 3) {
        return true
      }
      return false
    },
    getPraiseCount() {
      return this.praiseCount > this.countUnit
        ? Number(this.praiseCount/this.countUnit).toFixed(1) + 'w'
        : this.praiseCount
          ? this.praiseCount
          : 0
    },
  },
  async mounted() {
    this.menuDataList = await filterMenu(this.$CONFIG.defMenu)
  }
}
</script>

<style lang="stylus">
$black = #000
$white = #fff
.right-menu
  position: fixed
  right: 5px
  bottom: 200px
  width: 40px
  z-index: 10
  .right-menu-list
    .menu-item
      display: block
      width: 40px
      height: 40px
      margin-bottom: 5px
      background-color: rgba(47, 54, 64, .9)
      color: $white
      font-size: 12px
      cursor: pointer
      text-align: center
      &:hover
        background-color: rgba(47, 54, 64, .7)
        color: #17fd35
      span
        display: block
        height: 100%
      .menu-text
        left: 0
        right: 0
        bottom: 0
</style>
